package com.badibadi.fragment;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import net.tsz.afinal.FinalBitmap;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.amap.api.maps2d.AMap;
import com.amap.api.maps2d.CameraUpdateFactory;
import com.amap.api.maps2d.MapView;
import com.amap.api.maps2d.AMap.InfoWindowAdapter;
import com.amap.api.maps2d.AMap.OnInfoWindowClickListener;
import com.amap.api.maps2d.AMap.OnMarkerClickListener;
import com.amap.api.maps2d.model.BitmapDescriptorFactory;
import com.amap.api.maps2d.model.LatLng;
import com.amap.api.maps2d.model.Marker;
import com.amap.api.maps2d.model.MarkerOptions;
import com.amap.api.maps2d.model.PolylineOptions;
import com.android.volley.toolbox.NetworkImageView;
import com.badibadi.activity.PinyinSeeRecordParticipantsActivity;
import com.badibadi.fragment.LogReadingFragment2.ViewHolder;
import com.badibadi.infos.Article_Area_Model;
import com.badibadi.infos.Record_Info_Model_1;
import com.badibadi.infos.Record_Info_Model_2;
import com.badibadi.infos.Results;
import com.badibadi.mytools.AMapUtils;
import com.badibadi.mytools.Constants;
import com.badibadi.mytools.DisplayUtil;
import com.badibadi.mytools.JSONUtils;
import com.badibadi.mytools.MyThreadTool;
import com.badibadi.mytools.Utils;
import com.badibadi.mytools.VolleyTools;
import com.badibadi.uniclubber.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
//canjiazhe
public class LogReadingDanjiFragment2 extends BaseFragment implements
		OnMarkerClickListener, OnInfoWindowClickListener, InfoWindowAdapter {
	protected static final String TAG = "LogReadingFragment2";
	static LogReadingDanjiFragment2 logReadingDanjiFragment2;
	// 下面是地图的
	private AMap aMap;
	private MapView mapView;

	private String rid;
	private Article_Area_Model article_Area_Model;
	// private FinalBitmap finalBitmap;
	private DisplayImageOptions options;
	ViewHolder holder = new ViewHolder();

//	private float MarkerColor[] = { BitmapDescriptorFactory.HUE_BLUE,
//			BitmapDescriptorFactory.HUE_GREEN, BitmapDescriptorFactory.HUE_RED,
//			BitmapDescriptorFactory.HUE_YELLOW,
//			BitmapDescriptorFactory.HUE_CYAN,
//			BitmapDescriptorFactory.HUE_MAGENTA, };
	private int MarkerColor[]={
			0,1,2,3,4,5
	};
	private int LineColor[] = { Color.BLUE, Color.GREEN, Color.RED,
			Color.YELLOW, Color.CYAN, Color.MAGENTA,

	};

	private int markerColor = 0;// 和MarkerColor计数的，和Markercolor配合使用
	private int lineColor = 0;// 这是LineColor；计数的,he LineColor配合使用

	private boolean CameraISMove = false;
	List<Record_Info_Model_2> info;
	List<Record_Info_Model_2> infos;// 保存过滤的头像
	private Handler handler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case 1:
				Utils.ExitPrgress(getActivity());
				try {
					Utils.showMessage(getActivity(), getResources()
							.getString(R.string.l_net_error));
				} catch (Exception e) {
					// TODO: handle exception
				}
				break;
			case 2:
				Utils.ExitPrgress(getActivity());
				try {
					initView();
				} catch (Exception e) {
					// TODO: handle exception
				}
				break;
			case 3:
				Utils.ExitPrgress(getActivity());
				try {
					Utils.showMessage(getActivity(), getResources().getString(R.string.l_xb49));
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			default:
				break;
			}
		}

	};

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		rid = getArguments().getString("rid");
		// finalBitmap = FinalBitmap.create(getActivity());
		// finalBitmap.configLoadfailImage(R.drawable.noimage);
		// finalBitmap.configLoadingImage(R.drawable.noimage);

		options = new DisplayImageOptions.Builder()
				.showStubImage(R.drawable.ic_stub)
				.showImageForEmptyUri(R.drawable.noimage)
				.showImageOnFail(R.drawable.noimage).cacheInMemory()
				.cacheOnDisc().displayer(new RoundedBitmapDisplayer(5)).build();

	}

	// private void AddCity(String name, LinearLayout v) {
	// Button button = new Button(getActivity());
	// button.setText(name);
	// button.setBackgroundResource(R.drawable.shape_blue_circular_bead_100);
	// button.setTextColor(getActivity().getResources()
	// .getColor(R.color.white));
	// v.addView(button);
	// }
	/**
	 * 把相同的id的用户过滤掉
	 * 
	 * @param info
	 * @return
	 */
	public List<Record_Info_Model_2> guolv(List<Record_Info_Model_2> info) {
		final List<Record_Info_Model_2> infos2 = new ArrayList<Record_Info_Model_2>();
		Set<Integer> set = new HashSet<Integer>();
		for (int i = 0; i < info.size(); i++) {
			if (info.get(i).getId() != null)
				set.add(Integer.parseInt(info.get(i).getId()));
		}
		//    

		Iterator i1 = set.iterator();
		while (i1.hasNext()) {
			Integer temp = (Integer) i1.next();
			//    
			// infos.add(info.get(temp));

			for (int i = 0; i < info.size(); i++) {
				if (("" + info.get(i).getId()).equals("" + temp)) {
					infos2.add(info.get(i));
					break;
				}
			}
		}
		return infos2;
	}

	/**
	 * 更新ui
	 */
	protected void initView() {
//		   
//				"initView运行时间==》"
//						+ (new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"))
//								.format(System.currentTimeMillis()));
		// TODO Auto-generated method stub
		// 昵称
		if (article_Area_Model.getNickName() != null)
			holder.nickName.setText("" + article_Area_Model.getNickName());// 昵称
		// 投票数量
		if (article_Area_Model.getVote() != null)
			holder.vote.setText("" + article_Area_Model.getVote());
		// 统计参加人数
		List<Record_Info_Model_1> ar = new ArrayList<Record_Info_Model_1>();

		// 参加者数量
		int canjiashuliang = 0;

		holder.canjiazhehead.removeAllViews();
		holder.canjiazhehead.setGravity(Gravity.CENTER_VERTICAL
				| Gravity.CENTER_HORIZONTAL);
		info = new ArrayList<Record_Info_Model_2>();
		for (int i = 0; i < article_Area_Model.getArticle().size(); i++) {

			if (article_Area_Model.getArticle().get(i).getUser() != null) {

				// info.add(article_Area_Model.getArticle().get(i).getUser());

				for (int j = 0; j < article_Area_Model.getArticle().get(i)
						.getUser().size(); j++) {
					Record_Info_Model_2 r = new Record_Info_Model_2();
					r.setId(article_Area_Model.getArticle().get(i).getUser()
							.get(j).getId());
					r.setNickName(article_Area_Model.getArticle().get(i)
							.getUser().get(j).getNickName());
					r.setIs_firend(article_Area_Model.getArticle().get(i)
							.getUser().get(j).getIs_firend());
					r.setHead(article_Area_Model.getArticle().get(i).getUser()
							.get(j).getHead());
					info.add(r);
				}

				// 参加者数量的
				canjiashuliang = canjiashuliang
						+ article_Area_Model.getArticle().get(i).getUser()
								.size();
			
			}

		}
       infos=guolv(info);
		////////////////////
		// 参加者头像的
		for (int j = 0; j < infos.size(); j++) {
			LayoutInflater inflater = LayoutInflater
					.from(getActivity());
			View view = inflater.inflate(R.layout.aah, null);
			ImageView iv = (ImageView) view.findViewById(R.id.aah);
			iv.setPadding(DisplayUtil.dip2px(getActivity(), 1), 0,
					DisplayUtil.dip2px(getActivity(), 1), 0);

			iv.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Intent intent = new Intent(getActivity(),
							PinyinSeeRecordParticipantsActivity.class);
					intent.putExtra("info", (Serializable) infos);

					startActivity(intent);
					getActivity().overridePendingTransition(
							R.anim.slide_left, R.anim.slide_right);
				}
			});
			try {
				// finalBitmap.display(iv, Constants.BadiDownImgUrl
				// + "/"
				// + article_Area_Model.getArticle().get(i)
				// .getUser().get(j).getHead(),
				// DisplayUtil.dip2px(getActivity(), 49),
				// DisplayUtil.dip2px(getActivity(), 49));
				ImageLoader.getInstance().displayImage(
						Constants.BadiDownImgUrl
								+ "/"
								+ infos.get(j)
										.getHead()+Constants.appPhoto4img, iv, options);
			} catch (Exception e) {
				// TODO: handle exception
			}

			holder.canjiazhehead.addView(view);
		}
		
		
		// 参加者数量
		holder.canjiarenshu.setText("(" + canjiashuliang + ")");

		try {
			// 头像
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/"
							+ article_Area_Model.getHead()+Constants.appPhoto4img, holder.head,
					options);
		} catch (Exception e) {
			// TODO: handle exception
		}
		SimpleDateFormat data = new SimpleDateFormat("yyyy.MM.dd");
		// 发表年月日
		String ymd = data.format((Double.parseDouble(article_Area_Model
				.getR_time().trim()) * 1000));
		// 距离今天多少天
		// j_time
		String j_time = article_Area_Model.getJ_time();
		// 多少人收藏
		String collect = article_Area_Model.getCollect();
		holder.timeandcolleat.setText(ymd + " | " + j_time + getResources().getString(R.string.wx_day) + " | " + collect
				+ getResources().getString(R.string.wx_txt_68));
		// 1 可以投票 0不可以投票
		if (article_Area_Model.getIs_vote().equals("1")) {
			{
				holder.is_vote.setSelected(false);
				holder.is_vote.setOnClickListener(new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						// 在这里点击后投票
					}
				});
			}
		} else if (article_Area_Model.getIs_vote().equals("0")) {
			holder.is_vote.setSelected(true);
			holder.is_vote.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					// 这里是为了防止viewHolder的特性
				}
			});

		}
		// 下面的全是标签的判断
		String a = article_Area_Model.getTypeName();
		String[] b = a.split(",");
		//    
//		   
		if (b.length > 0)
			holder.one.setText("" + b[0]);
		if (b.length > 1)
			holder.two.setText("" + b[1]);
		if (b.length > 2)
			holder.three.setText("" + b[2]);
		if (b.length > 3)
			holder.four.setText("" + b[3]);
		if (b.length > 4)
			holder.five.setText("" + b[4]);
		if (b.length <= 4) {
			holder.five.setVisibility(View.GONE);
			holder.l_four.setVisibility(View.GONE);
			holder.ll_five.setVisibility(View.GONE);
		}
		if (b.length <= 3) {
			holder.four.setVisibility(View.GONE);
			holder.l_three.setVisibility(View.GONE);
			holder.ll_four.setVisibility(View.GONE);
		}
		if (b.length <= 2) {
			holder.three.setVisibility(View.GONE);
			holder.l_two.setVisibility(View.GONE);
			holder.ll_three.setVisibility(View.GONE);
		}
		if (b.length <= 1) {
			holder.two.setVisibility(View.GONE);
			holder.l_one.setVisibility(View.GONE);
			holder.ll_two.setVisibility(View.GONE);
		}
		if (b.length <= 0) {
			holder.one.setVisibility(View.GONE);
			holder.ll_one.setVisibility(View.GONE);
		}

		addMarkersToMapAddZhan_Name();

	}

	/**
	 * 添加站点 和 在地图上添加定位标记
	 */
	private void addMarkersToMapAddZhan_Name() {
//		   
//				"addMarkersToMapAddZhan_Name运行时间==》"
//						+ (new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"))
//								.format(System.currentTimeMillis()));
		List<LatLng> list_latlng = new ArrayList<LatLng>();
		// 这是用于记录每一站最后一个LoglatLng，是为了将不同站的线连起来，否则会在第一站完成后断开
		LatLng LoglatLng = null;
		for (int i = 0; i < article_Area_Model.getArticle().size(); i++) {
			// 添加站点
			String zhan_name = article_Area_Model.getArticle().get(i)
					.getZhan_name();
			String[] c = zhan_name.split(",");
			for (int j = 0; j < c.length; j++) {

				if (!c[j].equals(""))
					Utils.AddCity(getActivity(), c[j], holder.ll_zhanName);
			}
			// 下面的是在地图上画Marker图
			String[] m_x = ((article_Area_Model.getArticle().get(i).getMap_x())
					.split(","));
			String[] m_y = ((article_Area_Model.getArticle().get(i).getMap_y())
					.split(","));
			for (int j = 0; j < m_x.length; j++) {
//				   
//				   
//				   
				LatLng latlng = new LatLng(Double.parseDouble(m_x[j]),
						Double.parseDouble(m_y[j]));
				list_latlng.add(latlng);

				AMapUtils.drawOtherColorMarker(getActivity(),aMap, latlng, "" + i,
						MarkerColor[markerColor],j+1);
				// aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f)
				// .position(latlng).title(""+i)
				// .snippet("地址").draggable(true));
				if ((CameraISMove) == false) {
					aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latlng,
							12));
					CameraISMove = true;
				}

			}
			// 绘制多条线
			for (int j = 0; j < list_latlng.size() - 1; j++) {
				// LoglatLng只是为了让不同的站点联系起来
				if (LoglatLng == null) {

				} else if (j == 0 && LoglatLng != null) {
					AMapUtils.drawLine(aMap, LoglatLng, list_latlng.get(0),
							LineColor[lineColor]);
				}
				// aMap.addPolyline((new PolylineOptions()).add(
				// list_latlng.get(j), list_latlng.get(j+1)).color(
				// LineColor[1]));
				AMapUtils.drawLine(aMap, list_latlng.get(j),
						list_latlng.get(j + 1), LineColor[lineColor]);

				if (j == list_latlng.size() - 2) {
					// 记录最后一个
					LoglatLng = list_latlng.get(list_latlng.size() - 1);
				}

			}
			//如果只有一条数据
			if(list_latlng.size()==1)
			{
				
				if (LoglatLng != null) {
					AMapUtils.drawLine(aMap, LoglatLng, list_latlng.get(0),
							LineColor[lineColor]);
					LoglatLng=list_latlng.get(0);
//					   
				}else
				{
					LoglatLng=list_latlng.get(0);
				}
			}
			list_latlng.clear();
			// 根据不站点来设置不同的颜色
			if (markerColor == MarkerColor.length - 1) {
				markerColor = 0;
			} else {
				markerColor++;
			}

			if (lineColor == LineColor.length - 1) {
				lineColor = 0;
			} else {
				lineColor++;
			}
		}
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View view = inflater.inflate(R.layout.fragment_log_reading03, null);
		mapView = (MapView) view.findViewById(R.id.map);
		mapView.onCreate(savedInstanceState);// 此方法必须重写

		init(view);
		LoadingInterNet();
		return view;
	}

	/**
	 * 初始化AMap对象
	 */
	private void init(View convertView) {
		if (aMap == null) {
			aMap = mapView.getMap();
			setUpMap();
		}
		initViewID(convertView);
	}

	/**
	 * 初始化view的id
	 * 
	 * @param convertView
	 */
	private void initViewID(View convertView) {
		// TODO Auto-generated method stub
		holder.nickName = (TextView) convertView.findViewById(R.id.nickName);
		holder.timeandcolleat = (TextView) convertView
				.findViewById(R.id.timeandcolleat);
		holder.head = (ImageView) convertView.findViewById(R.id.head);
		holder.canjiazhehead = (LinearLayout) convertView
				.findViewById(R.id.canjiarenhead);
		holder.canjiarenshu = (TextView) convertView
				.findViewById(R.id.canjiarenshu);
		holder.is_vote = (Button) convertView.findViewById(R.id.is_vote);
		holder.vote = (TextView) convertView.findViewById(R.id.vote);
		holder.one = (TextView) convertView.findViewById(R.id.one);
		holder.l_one = (LinearLayout) convertView.findViewById(R.id.l_one);
		holder.two = (TextView) convertView.findViewById(R.id.two);
		holder.l_two = (LinearLayout) convertView.findViewById(R.id.l_two);
		holder.three = (TextView) convertView.findViewById(R.id.three);
		holder.l_three = (LinearLayout) convertView.findViewById(R.id.l_three);
		holder.four = (TextView) convertView.findViewById(R.id.four);
		holder.l_four = (LinearLayout) convertView.findViewById(R.id.l_four);
		holder.five = (TextView) convertView.findViewById(R.id.five);
		holder.ll_one = (LinearLayout) convertView.findViewById(R.id.ll_one);
		holder.ll_two = (LinearLayout) convertView.findViewById(R.id.ll_two);
		holder.ll_three = (LinearLayout) convertView
				.findViewById(R.id.ll_three);
		holder.ll_four = (LinearLayout) convertView.findViewById(R.id.ll_four);
		holder.ll_five = (LinearLayout) convertView.findViewById(R.id.ll_five);
		holder.ll_zhanName = (LinearLayout) convertView
				.findViewById(R.id.ll_zhanName);
	}

	private void setUpMap() {
		// TODO Auto-generated method stub
		aMap.setInfoWindowAdapter(this);// 设置自定义InfoWindow样式
		aMap.setOnMarkerClickListener(this);// 设置点击marker事件监听器

	}

	/**
	 * 获取数据
	 */
	private void LoadingInterNet() {
		MyThreadTool.fixedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				Map<String, Object> map = new HashMap<String, Object>();
				String content = Utils.getRequest(Constants.BadiUrl
						+ "article_area?rid=" + rid + "&uid="
						+ Utils.getUid(getActivity()));
//				   
//				   
				if (content != null) {
					Results results = Utils.checkResult_NNN(getActivity(),
							content);
//					   
					if (results != null && !results.getRetmsg().equals("null")
							&& results.isRet()) {
//						   
						try {
							article_Area_Model = JSONUtils
									.getEntityByJsonString(results.getRetmsg(),
											Article_Area_Model.class);
							handler.sendEmptyMessage(2);
						} catch (Exception e) {
							   
						}
					} else {

						handler.sendEmptyMessage(3);
					}
				} else {

					handler.sendEmptyMessage(1);
				}
			}
		});
	}

	/**
	 * 方法必须重写
	 */
	@Override
	public void onResume() {
		super.onResume();
		mapView.onResume();
	}

	/**
	 * 方法必须重写
	 */
	@Override
	public void onPause() {
		super.onPause();
		mapView.onPause();
	}

	/**
	 * 方法必须重写
	 */
	@Override
	public void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		mapView.onSaveInstanceState(outState);
	}

	/**
	 * 方法必须重写
	 */
	@Override
	public void onDestroy() {
		super.onDestroy();
		mapView.onDestroy();
	}

	class ViewHolder {
		public TextView nickName;// 发表用户的
		public TextView timeandcolleat;
		public LinearLayout canjiazhehead;// 参加者头像
		public ImageView head;// 发表用户头像
		public Button is_vote;// 是否可以投票 1表示可以 0 不可以
		public TextView canjiarenshu;// 参加人数
		// 五个标签
		public TextView one;
		public TextView two;
		public TextView three;
		public TextView four;
		public TextView five;

		public LinearLayout l_one;
		public LinearLayout l_two;
		public LinearLayout l_three;
		public LinearLayout l_four;

		public LinearLayout ll_one;
		public LinearLayout ll_two;
		public LinearLayout ll_three;
		public LinearLayout ll_four;
		public LinearLayout ll_five;

		public TextView vote;// 目前的票数

		public TextView uid;// 发表用户的id
		public TextView r_time;// 记录发表的时间
		public TextView j_time;// 记录时间距今天多少
		public TextView collect;// 被收藏的次数

		public TextView typeName;// 记录的标签名字 格式
									// $typeName1,$typeName2,$typeName3,$typeName4,$typeName5
		public TextView p_num;// @的人数
		public List<Record_Info_Model_1> acticle;// 记

		// **
		// startTimeandendTime
		// 下面的是记的
		public TextView startTimeandendTime;
		// 第几记
		public TextView dijiji;
		public NetworkImageView image;
		public LinearLayout ll_zhanName;
		public TextView title;
	}

	@Override
	public boolean onMarkerClick(Marker marker) {
		// TODO Auto-generated method stub
//		   
//				+ "marker.getPosition==>" + marker.getPosition());
		return false;
	}

	@Override
	public void onInfoWindowClick(Marker marker) {
		// TODO Auto-generated method stub
//		Utils.showMessage(getActivity(), "你点击了infoWindow窗口" + marker.getTitle());
	}

	/**
	 * 监听自定义infowindow窗口的infocontents事件回调
	 */
	@Override
	public View getInfoContents(Marker marker) {
		// TODO Auto-generated method stub
		// View infoContent = getActivity().getLayoutInflater().inflate(
		// R.layout.custom_info_contents, null);
		// render(marker, infoContent);
		return null;
	}

	/**
	 * 监听自定义infowindow窗口的infowindow事件回调
	 */
	@Override
	public View getInfoWindow(Marker marker) {
		// TODO Auto-generated method stub
		View infoWindow = getActivity().getLayoutInflater().inflate(
				R.layout.custom_info_window, null);

		render(marker, infoWindow);
		return infoWindow;
	}

	private void render(Marker marker, View view) {
		// TODO Auto-generated method stub
		ImageView img = (ImageView) view.findViewById(R.id.img);
		String p = marker.getTitle();
//		   
		int pos = Integer.parseInt(marker.getTitle().toString());
		try {
			// VolleyTools.displayImageByNetworkImageView(getActivity(),
			// Constants.BadiDownImgUrl
			// + "/"
			// + article_Area_Model.getArticle().get(pos)
			// .getImg_show().getPath(), img);
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl
							+ "/"
							+ article_Area_Model.getArticle().get(pos)
									.getImg_show().getPath()+Constants.App9block, img, options);
		} catch (Exception e) {
			// TODO: handle exception
		}
		// 数量
		TextView imgNum = (TextView) view.findViewById(R.id.imgNum);
		imgNum.setText(""
				+ article_Area_Model.getArticle().get(pos).getImg_show()
						.getImgNum());
		// 地址
		TextView address = (TextView) view.findViewById(R.id.address);
		address.setText(""
				+ article_Area_Model.getArticle().get(pos).getImg_show()
						.getAddress());
		// 内容
		TextView info = (TextView) view.findViewById(R.id.info);
		info.setText(""
				+ article_Area_Model.getArticle().get(pos).getImg_show()
						.getInfo());

		// String title = marker.getTitle();
		// TextView titleUi = ((TextView) view.findViewById(R.id.title));
		// if (title != null) {
		// SpannableString titleText = new SpannableString(title);
		// titleText.setSpan(new ForegroundColorSpan(Color.RED), 0,
		// titleText.length(), 0);
		// titleUi.setTextSize(15);
		// titleUi.setText(titleText);
		//
		// } else {
		// titleUi.setText("");
		// }
	}

	public static LogReadingDanjiFragment2 getInstance() {
		if (logReadingDanjiFragment2 == null) {
			return new LogReadingDanjiFragment2();
		}
		return logReadingDanjiFragment2;
	}
}